<?php

function select_numbers($from, $to, $countdown = false, $html_attr = array()){
    $select = "<select " . html_attributes($html_attr) . ">";
    if(!$countdown):
        for($i = $from; $i <= $to; $i++):
            $select .= "<option value=\"$i\">$i</option>";
        endfor;
    else:
        for($i = $to; $i >= $from; $i--):
            $select .= "<option value=\"$i\">$i</option>";
        endfor;        
    endif;
    $select .= "</select>";
    return $select;
}

?>
